package com.example.swordjava;


import java.util.HashMap;
import java.util.Map;

public class Test48 {

    public static void main(String[] args) {

        int[][] a = {{1, 2, 3, 4},
                {5, 6, 7, 8},
                {9, 10, 11, 12},
                {13, 14, 15, 16}};

        System.out.println(Math.pow(1, 10));

    }

    public class TreeNode {
        int val = 0;
        TreeNode left = null;
        TreeNode right = null;

        public TreeNode(int val) {
            this.val = val;

        }
    }

    /**
     * 最长不含重复字符的子字符串
     * 请从字符串中找出一个最长的不包含重复字符的子字符串，计算该最长子字符串的长度。
     */

    public int lengthOfLongestSubstring(String s) {
        // write code here
        int left = 0;
        int right = 0;
        int res = 0;
        while (right < s.length()) {
            while (s.substring(left, right).contains(s.charAt(right) + "")) {
                left++;
            }
            res = Math.max(res, right - left + 1);

            right++;
        }
        return res;
    }

}














